﻿using System.Linq;
using CxRomos.Core.Domain.Entities;
using NHibernate;
using NHibernate.Linq;

namespace CxRomos.Core.Domain {
    public class CxRomosContext {
        private readonly ISession _session;

        public CxRomosContext(ISession session) {
            _session = session;
        }

        public IQueryable<Person> Persons {
            get { return _session.Query<Person>(); }
        }

        public IQueryable<AccountPermission> AccountPermissions {
            get { return _session.Query<AccountPermission>(); }
        }

        public IQueryable<Account> Accounts {
            get { return _session.Query<Account>(); }
        }

        public IQueryable<Permission> Permissions {
            get { return _session.Query<Permission>(); }
        }

        public IQueryable<Profile> Profiles {
            get { return _session.Query<Profile>(); }
        }

        public IQueryable<Term> Terms {
            get { return _session.Query<Term>(); }
        }
    }
}